import request from "@/utils/request";

//办理入住
export function makeCheckIn(data){
  return request({
    url: '/sale/makeCheckIn',
    method: 'post',
    data: data
  })
}

//查询订单
export function listSale(query) {
  return request({
    url: '/sale/listSale',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getSale(saleId) {
  return request({
    url: '/Sale/' + saleId,
    method: 'get'
  })
}

// 新增订单
export function addSale(data) {
  return request({
    url: '/sale',
    method: 'post',
    data: data
  })
}

// 录入订单明细
export function enterItem(params) {
  return request({
    url: '/sale/enterItem',
    method: 'get',
    params: params
  })
}
// 结束录入
export function endSale() {
  return request({
    url: '/sale/endSale',
    method: 'get'
  })
}

// 确认支付
export function makePayment(cash) {
  return request({
    url: '/sale/makePayment',
    method: 'get',
    params: { cash: cash }
  });
}


// 获得热销产品数据
export function getPieDataList(timeParams) {
  return request({
    url: '/sale/pie',
    method: 'get',
    params: timeParams
  })
}

// 获得热销产品数据
export function getBarDataList(year) {
  return request({
    url: '/sale/bar',
    method: 'get',
    params: { year: year }
  })
}

// 提供房间
export function provideRoom(categoryName) {
  return request({
    url: '/sale/provide',
    method: 'get',
    params: { categoryName: categoryName }
  })
}


